﻿@using Coralcode.Utils.Basic
@model Coralcode.Adapter.StatVisit.Entity.Domains.StatReportDomain

<div class="clearfix">
            <div class="filter_btn clearfix pt_1 f_l">
                <a @if(ViewBag.IsToday){@String.Format("class=current")} href="@(ViewBag.CurrentPageUrl)dateselect=today">今天</a>
                <a @if(ViewBag.IsYesterday){@String.Format("class=current")} href="@(ViewBag.CurrentPageUrl)dateselect=yesterday">昨天</a>
                <a @if(ViewBag.IsLast7Days){@String.Format("class=current")} href="@(ViewBag.CurrentPageUrl)dateselect=last7days">最近7天</a>
                <a class="last @if(ViewBag.IsLast30Days){@String.Format("current")}" href="@(ViewBag.CurrentPageUrl)dateselect=last30days">最近30天</a>
            </div>
            <div class="pt_1 pl_2 f_l clearfix filter_btn ">
                <span class="f_l">筛选范围：</span>
                <div class="datepicker f_l">
                    <input type="text" class=" text w_8" value="@ViewBag.DateStart" data-js="datepicker" /><div class="btn">
                                                                                                               <span class="ico ico_datepicer"></span>
                                                                                                           </div>
                </div>
                <span class="f_l pl_1 pr_1">至</span>
                <div class="datepicker f_l">
                    <input type="text" class=" text w_8" value="@ViewBag.DateEnd" data-js="datepicker" /><div class="btn">
                                                                                                             <span class="ico ico_datepicer"></span>
                                                                                                         </div>
                </div>
            </div>
        </div>
<div class="main-box mt_1">
    <ul class="visit_count clearfix">
        <li><div class="t">浏览次数(PV)</div>
            <b>@Model.PageView</b>
        </li>
        <li><div class="t">独立访客 (UV)</div>
            <b>@Model.UniqueVisitor</b>
        </li>
        <li><div class="t">IP</div>
            <b>@Model.IpCount</b>
        </li>
        <li><div class="t">新独立访客</div>
            <b>@Model.NewUniqueVisitor</b>
        </li>
        <li><div class="t">访问次数</div>
            <b>@Model.SessionCount</b>
        </li>
        <li><div class="t">人均浏览页数</div>
            <b>@MathUtil.Round(Model.PageViewAverage)</b>
        </li>
        <li><div class="t">平均访问深度</div>
            <b>@MathUtil.Round(Model.PageDepthAverage)</b>
        </li>
    </ul>
</div>
<script type="text/javascript">
    $(function () {
        $("[data-js='datepicker']").change(function() {
            var starttime = $("[data-js='datepicker']:first").val();
            var endtime = $("[data-js='datepicker']:last").val();
            window.location = "@Html.Raw(ViewBag.CurrentPageUrl)dateStart=" + starttime + "&dateEnd=" + endtime;
        });
    });
</script>
